export default {
	beforeRouteLeave(to, from, next) {
		const manageTable = this.$refs.manageTable;
		if (manageTable.editControl.editable) {
			this.$confirm('系统可能不会保存您所做的更改, 是否继续?', '提示', {
				confirmButtonText: '确定',
				cancelButtonText: '取消',
				type: 'warning'
			})
				.then(() => {
					manageTable.handleSaveClose(manageTable.editControl.temp);
					next();
				})
				.catch(() => {
					next(false);
				});
		} else {
			next();
		}
	}
};
